"use strict";
exports.__esModule = true;
var electron_1 = require("electron");
var node_path_1 = require("node:path");
var electron_is_dev_1 = require("electron-is-dev");
var path_1 = require("path");
function createAddStockWindow() {
    var addStockWindow = new electron_1.BrowserWindow({
        width: 400,
        height: 600,
        type: "toolbar",
        frame: true,
        titleBarStyle: "hidden",
        resizable: false,
        alwaysOnTop: true,
        webPreferences: {
            nodeIntegration: true,
            contextIsolation: true,
            preload: node_path_1["default"].join(__dirname, "preload.js")
        }
    });
    var port = process.env.PORT || 3000;
    var url = electron_is_dev_1["default"]
        ? "http://localhost:".concat(port, "/addStock/")
        : (0, path_1.join)(__dirname, "../src/out/addStock.html");
    // and load the index.html of the app.
    if (electron_is_dev_1["default"]) {
        addStockWindow === null || addStockWindow === void 0 ? void 0 : addStockWindow.loadURL(url);
    }
    else {
        addStockWindow === null || addStockWindow === void 0 ? void 0 : addStockWindow.loadFile(url);
    }
}
exports["default"] = createAddStockWindow;
